package com.designPattern.p03FactoryMethod.instance;

/**
 * @author: luhd
 * @create: 2021-09-03
 */
public class Test {
    public static void main(String[] args) {
        // 获取具体的工厂类
        FruitFactory fruitFactory = new AppleFactory();
        FruitFactory fruitFactory2 = new OrangeFactory();
        // 通过具体的工厂类 获得具体的产品对象
        Fruit apple = fruitFactory.createFruit();
        Fruit orange = fruitFactory2.createFruit();
        // 获取产品类的方法
        apple.get();
        orange.get();
    }
}
